﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8" />
    <title>@ConfigHelper.GetSiteTitle()</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/js")
    @Scripts.Render("~/Scripts/admin/DateInput/WdatePicker.js")
    @Styles.Render("~/Content/autocomplete/jquery-ui.css")

    @using CNKI.TPI.Web.Base;
    <script type="text/javascript">

        function addCookie(objName, objValue, objHours) {//添加cookie 
            var str = objName + "=" + escape(objValue);
            if (objHours > 0) {//为0时不设定过期时间，浏览器关闭时cookie自动消失 
                var date = new Date();
                var ms = objHours * 3600 * 1000;
                date.setTime(date.getTime() + ms);
                str += "; expires=" + date.toGMTString();
            }
            document.cookie = str + ";path=/";
        }

        function getCookie(objName) {//获取指定名称的cookie的值 
            var arrStr = document.cookie.split("; ");
            for (var i = 0; i < arrStr.length; i++) {
                var temp = arrStr[i].split("=");
                if (temp[0] == objName)
                    return unescape(temp[1]);
            }
        }

        $(function () {

            //点击时session标志赋值
            $(".nav-i a").click(function () {
                var url = $(this).attr("href");
                addCookie("Menu", url, 0);
            })

            //页面加载时判断
            //var sessionStr = "/";
            //sessionStr = getCookie("Menu");
            //if (sessionStr == undefined || sessionStr == "/") {
            //    $("#curhome").addClass("nav-a1 nowOnNav");
            //}
            //else {
            //    $(".nav-i a").each(function (i) {
            //        if (sessionStr == $(this).attr("href"))
            //            $(this).addClass("nav-a1 nowOnNav");
            //        else
            //            $(this).removeClass("nav-a1 nowOnNav");
            //    });
            //}
        })

        //解决浏览器缓存
        function timestamp(url) {
            var getTimestamp = new Date().getTime();
            if (url.indexOf("?") > -1) {
                url = url + "&t=" + getTimestamp
            } else {
                url = url + "?t=" + getTimestamp
            }
            return url;
        }
    </script>
    <style>
        /*重写提示框样式*/
        .ui-dialog .ui-dialog-titlebar {
            padding: 3px;
        }

        .ui-dialog .ui-dialog-buttonpane {
            margin: 0px;
            padding: 0px;
        }

        .ui-dialog-title {
            padding-left: 5px;
        }
        /*改变标题颜色*/
        .ui-widget-header {
            background-color: #107bce;
            border: 1px solid #107bce;
            background-image: none;
        }

        .ui-front {
            z-index: 999999999;
        }
    </style>
</head>
<body style="position:relative">
    <!--页面头部==开始-->
    <div class="header">
        <div class="header_t">
            <div class="header_t_in header_t_in-i clearfix">
                <div class="gp-n" style="_width: 100px;">
                    <ul class="nav navs01">
                        @*<li><a href="javascript:void(0);" class="no_border no_padding">设为首页</a></li>*@
                    </ul>
                </div>

                <div class="gp-u">
                    @{ 
                        bool anonymousControlFlag = CNKI.TPI.Web.Base.ConfigHelper.IsAnonymousControlEnabled();
                        string anonymousUsername = CNKI.TPI.Web.Base.ConfigHelper.GetAnonymousAccount();
                        string currentUsername = "";
                        if (CNKI.TPI.Web.Base.SessionHelper.IsUserInfoExsit())
                        {
                            currentUsername = CNKI.TPI.Web.Base.SessionHelper.GetUserInfo().UserCode;
                        }
                    }

                    @if (CNKI.TPI.Web.Base.SessionHelper.IsUserInfoExsit() && ((anonymousControlFlag && !anonymousUsername.Equals(currentUsername)) || !anonymousControlFlag))
                    {
                        CNKI.TPI.Web.Search.Model.LoginUserInfo userInfo = CNKI.TPI.Web.Base.SessionHelper.GetUserInfo();
                        string username = string.IsNullOrEmpty(userInfo.UserName) ? userInfo.UserCode : userInfo.UserName;
                            
                        <div class="welcome">@username 您好！</div>
                        <div class="welcome">
                            @if (userInfo.LoginType == 1)
                            {
                                using (Html.BeginForm("LogOffSSO", "Account", FormMethod.Post, new { id = "logoutForm" }))
                                {
                                    @Html.AntiForgeryToken()
                                    <a href="javascript:document.getElementById('logoutForm').submit()">注销</a>
                                }
                            }
                            else
                            {
                                using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" }))
                                {
                                    @Html.AntiForgeryToken()
                                    <a href="javascript:document.getElementById('logoutForm').submit()">注销</a>
                                }
                            }
                        </div>
                    }
                    else
                    {
                        <div class="welcome">
                            @if (ConfigHelper.IsSSOEnabled())
                            {
                                <a href="~/Account/LoginSSO?ReturnUrl=@Uri.EscapeDataString(Request.Url.AbsoluteUri)">登录</a>
                            }
                            else
                            {
                                @Html.ActionLink("登录", "Login", "Account", routeValues: new { ReturnUrl = Request.RawUrl }, htmlAttributes: new { id = "loginLink" })
                            }
                        </div>
                    }
                    <!-- <div class="headerList">
                        <a href="javascript:void(0);" class="nowHoverOn">管理 <i class="iconfont">&#xf000a;</i></a>
                    </div> -->
                    <ul class="nav">
                        @*<li><a class='nav-li1' href="javascript:void(0);" target="_blank">加入收藏</a></li>*@
                        @*            <li><a href="javascript:void(0);" target="_blank">系统帮助</a></li>*@
                        <li><a href="~/Admin">登录后台</a></li>
                        @{
                            if (ConfigHelper.IsSSOEnabled() && ((!CNKI.TPI.Web.Base.SessionHelper.IsUserInfoExsit()) || (anonymousControlFlag && anonymousUsername.Equals(currentUsername))))
                            {
                                <li><a href="~/Account/Login?ReturnUrl=@Uri.EscapeDataString(Request.RawUrl)">本地账号登录</a></li>
                            }
                        }
                    </ul>
                </div>
            </div>
        </div>
        <div class="header_b">
            <img src="~/Images/logo185-40.png" alt="logo" />
            @*<div class="logo185-40"></div>*@
            @*<h1 class='f34 fl'>信息资源建设与管理平台</h1>*@
        </div>
    </div>

@using CNKI.TPI.Web.Admin.IBLL
@using CNKI.TPI.Web.Admin.Model
    <!--主导航2(深色系).选中状态变色-->
    <div class="bigNavBody nav02Body">
        <div class="bigNav nav02 nav-i clearfix">
            <div class="fl">
                            @{
                                IHomeConfigService homeService = Autofac.Integration.Mvc.AutofacDependencyResolver.Current.GetService<IHomeConfigService>();
                                IList<SYS_CMS_NEWS_MENUCONFIG> MenuList = homeService.GetMenuList(cacheTime: 300);
                                string path = Request.ApplicationPath == "/" ? "" : Request.ApplicationPath;
                                foreach (SYS_CMS_NEWS_MENUCONFIG item in MenuList)
                                {
                                    if (item.URL.ToLower().StartsWith("http"))
                                    {
                                        <a href="@item.URL" target="_blank"><span>@item.NAME</span></a>
                                    }
                                    else
                                    {
                                        if (Request.Path.Equals(path + item.URL))
                                        {
                                            <a href="@path@item.URL" class="nav-a1 nowOnNav"><span>@item.NAME</span></a>
                                        }
                                        else if ((Request.Path.Contains("SingleSearch") || Request.Path.Contains("MultiSearch")) && item.URL.Equals("/DocResource"))
                                        {
                                            <a href="@path@item.URL" class="nav-a1 nowOnNav"><span>@item.NAME</span></a>
                                        }
                                        else if (Request.Path.Contains("SubmitOnline") && item.URL.Equals("/Submit"))
                                        {
                                            <a href="@path@item.URL" class="nav-a1 nowOnNav"><span>@item.NAME</span></a>
                                        }
                                        else if (Request.Path.Contains("/Submit/ReViewIndex") && item.URL.Equals("/Submit/ReViewListIndex"))
                                        {
                                            <a href="@path@item.URL" class="nav-a1 nowOnNav"><span>@item.NAME</span></a>
                                        }
                                        else
                                        {
                                            <a href="@path@item.URL"><span>@item.NAME</span></a>
                                        }
                                    }
                                }
                            }
            </div>
        </div>
    </div>

    <div id="body">
        @*        @RenderSection("featured", required: false)*@
        @RenderBody()
    </div>
    <!--尾部==开始-->
    <div id="bottom">
        @RenderPage("FooterPartial.cshtml")
    </div>
    <input type="hidden" id="smartaddress" value="@Html.Raw(Url.Action("index", "SmartWord"))"/>
    <input type="hidden" id="smartwordtag" value="@ConfigHelper.GetSmartTag()"/>
    <!--透明背景-->
    <div class="talkDivBg" style="display: none; z-index: 999"></div>

    @*消息提示框*@
    <div id="dialog-message" title="消息提示">
        <p></p>
    </div>
    @*操作提示框*@
    <div id="dialog-confirm" title="操作提示">
        <p></p>
    </div>
</body>
</html>
